<template>
  <div class="main">
    <img src="~/static/coupon/validate_success.png" />
    <p class="header">自助核销成功</p>
    <p v-for="(item, index) in detailInfo.userCouponDestroy" :key="index">
      核销成功
      {{ item.couponType === "1" ? "现金券" : "" }}
      {{ item.couponType === "2" ? "折扣券" : "" }}
      {{ item.couponType === "3" ? "兑换券" : "" }}
      {{ item.couponType === "4" ? "洗车券" : "" }}
      :
      <span class="number">{{ item.num }}</span>
      张
    </p>
    <p>将该页面展示给油站工作人员</p>
    <p class="time">核销时间:{{ detailInfo.couponVtime }}</p>

    <van-button type="primary" style="width:90%" size="normal" @click="goback"
      >返回</van-button
    >
  </div>
</template>
<script>
import Vue from "vue";
import { Button } from "vant";

Vue.use(Button);
export default {
  head() {
    return {
      title: "核销成功"
    };
  },
  data() {
    return {
      detailInfo: {},
      type:null,
      stationId:null,
    };
  },
  created() {
    this.detailInfo = JSON.parse(this.$route.query.dataInfo);
    this.type=this.$route.query.couponType
    this.stationId= this.$route.query.stationId
  },
  methods: {
    goback() {
      window.location.href = `/${this.enterpriseId}/coupon/autoHexiao_index?couponType=${this.type}&stationId=${this.stationId}`;
    }
  }
};
</script>
<style lang="scss" scoped>
.main {
  min-height: 100vh;
  width: 100vw;
  text-align: center;
  font-size: 0.32rem;
  color: #999;

  .header {
    font-size: 0.4rem;
    color: #333;
    margin-bottom: 0.5rem;
  }
  .number {
    color: #07c160;
  }
  .time {
    margin-top: 1rem;
    margin-bottom: 2rem;
  }
  p {
    line-height: 0.32rem;
  }
  img {
    width: 100px;
    margin-top: 1rem;
  }
}
</style>
